<div id="header_top">
  <div id="top">
    <div class="Inside_pages">
    	{if $Think.session.user['id']}
    	<div class="Collection">欢迎您，<a href=""><strong>{$Think.session.user['username']}</strong></a> <a href="{:url('user/logout')}" class="green">退出</a>
		</div>
		{else}
		<div class="Collection">您好，欢迎来到17shop<a href="{:url('user/login')}" class="green">请登录</a> <a href="{:url('user/register')}" class="green">免费注册</a>
		</div>
		{/if}
	<div class="hd_top_manu clearfix">
	  <ul class="clearfix">
	   <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="{:url('index/index')}">首页</a></li> 
	   <li class="hd_menu_tit" data-addclass="hd_menu_hover"> <a href="{:url('personal/index')}">我的17</a> </li>
	   <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="{:url('personal/order')}">我的订单</a></li>
       <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="{:url('personal/collection')}">我的收藏</a></li>
        <li class="hd_menu_tit" data-addclass="hd_menu_hover"><a href="#">我的购物车
        {if $Think.session.user['id']}
        <b>({$shop_num})</b>
        {else}
        <b>(0)</b>
        {/if}
        </a></li>	
	  </ul>
	</div>
    </div>
  </div>
  <div id="header"  class="header page_style">
  <div class="logo"><a href="{:url('index/index')}"><img src="__STATIC__/index/images/logo1.png" /></a></div>
  <!--结束图层-->
  <div class="Search">
        <div class="search_list">
            <ul>
                <li class="current"><a href="#">产品</a></li>
                <li><a href="#">信息</a></li>
            </ul>
        </div>
        <div class="clear search_cur">
           <input name="searchName" id="searchName" class="search_box" onkeydown="keyDownSearch()" type="text">
           <input name="" type="submit" value="搜 索"  class="Search_btn"/>
        </div>
        <div class="clear hotword">热门搜索词：香醋&nbsp;&nbsp;&nbsp;茶叶&nbsp;&nbsp;&nbsp;草莓&nbsp;&nbsp;&nbsp;葡萄&nbsp;&nbsp;&nbsp;菜油</div>
</div>
 <!--购物车样式-->
 <div class="hd_Shopping_list" id="Shopping_list">
   <div class="s_cart"><a href="{:url('goods/shopping_cart')}">我的购物车</a> <i class="ci-right">&gt;</i><i class="ci-count" id="shopping-amount">
   	{if $Think.session.user['id']}
   	{$shop_num}
   	{else}
   	0
   	{/if}
   </i></div>
   <div class="dorpdown-layer">
    <div class="spacer"></div>
    {if $shop_num == 0}
	 <div class="prompt"></div><div class="nogoods"><b></b>购物车中还没有商品，赶紧选购吧！</div>
	 {else}
	 <ul class="p_s_list">
	 	{volist name="cars" id="vo"}	   
		<li>
		    <div class="img"><img src="{$vo.picture}"></div>
		    <div class="content"><p class="name"><a href="{:url('goods/goods_detail',['id'=>$vo.gid])}">{$vo.gname}</a></p><p><span class="num">数量：<strong>{$vo.num}</strong></span>&nbsp;<span>总计：￥{$vo.price*$vo.num}</span></p></div>
			<div class="Operations">
			<p class="Price">￥{$vo.price}</p>
			<p><a class="del" attr-id="{$vo.id}" href="javascript:void(0)">删除</a></p></div>
		 </li>
		{/volist}
	</ul>
	{/if}		
	 <div class="Shopping_style">
	 <div class="p-total">共<b>{$shop_num}</b>件商品　共计<strong>￥ </strong></div>
	  <a href="{:url('goods/shopping_cart')}" title="去购物车结算" id="btn-payforgoods" class="Shopping">去购物车结算</a>
	 </div>	 
   </div>
 </div>
</div>
<script>
$(function(){
	var gurl = "{:url('goods/goods_detail')}";
	$('.p_s_list .del').click(function(){
		var id = $(this).attr('attr-id');
      	var url = "{:url('goods/delete_car')}";
      	var data = {'id' : id};
      	$.post(url,data,function(result){
      		if (result.status == 1) {
      			$('.p_s_list').empty();
      			data = result.data;
		        var html = '';
		        $(data).each(function(){
		        	html += '<li><div class="img"><img src="'+this.picture+'"></div><div class="content"><p class="name"><a href="'+gurl+'?id='+this.gid+'">'+this.gname+'</a></p><p><span class="num">数量：<strong>'+this.num+'</strong></span>&nbsp;<span>总计：￥'+this.price * this.num+'</span></p></div><div class="Operations"><p class="Price">￥'+this.price+'</p><p><a class="del" attr-id="'+this.id+'" href="javascript:void(0)">删除</a></p></div></li>';
		        });
		        $('.p_s_list').html(html);
		    }else if(result.status == 0){
		    	alert(result.message);
		    }
      	},'json');
	})
});
</script>
<!--菜单栏-->
	<div class="Navigation" id="Navigation">
		 <ul class="Navigation_name">
			<li><a href="{:url('index/index')}">首页</a></li>
            <li class="hour"><span class="bg_muen"></span><a href="#">半小时生活圈</a></li>
			<li><a href="#">你身边的超市</a></li>
			<li><a href="#">预售专区</a><em class="hot_icon"></em></li>
			<li><a href="#">商城</a></li>
			
			<li><a href="#">好评商户</a></li>
			<li><a href="#">热销活动</a></li>
			<li><a href="#">联系我们</a></li>
		 </ul>			 
		</div>
	<script>$("#Navigation").slide({titCell:".Navigation_name li",trigger:"click"});</script>
</div>